const app = getApp()
const WXAPI = require("../../../../api/newApi")
Page({

  /**
   * 页面的初始数据
   */
  data: {
    ls:[],
    orderLs: [],
    isShow: false,
    info:{},
    id: '',
  },

  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function (options) {
    this.setData({
      statusHeight: app.gettop.height,
      status: app.gettop.status,
      navHeight:app.gettop.navHeight,
      mobbleBottom: app.mobile.mobbleBottom
    })
    this.data.id = options.id
    this.getInfo()
  },

  /**
   * 生命周期函数--监听页面显示
   */
  onShow: function () {

  },
  getInfo(){ //receiveGive
    wx.showLoading({
      title: '',
    })
    var data = {
      id: this.data.id,
    }
    WXAPI.receiveGive(data, (res) => {
      const data = res.result
      if (res.code == 200) {
        this.setData({
          info:res.result
        })
        wx.hideLoading()
      }
    })
  },
  copy(){ //复制
    wx.setClipboardData({
      data: this.data.info.orderNo,
      success (res) {
        wx.showToast({
          title: '复制成功',
        })
      }
    })    
  },
  back(){
    wx.navigateBack({
      delta: 0,
    })
  },
  openDetail(){
    this.setData({
      isShow: true
    })
  },
  closeDetail(){
    this.setData({
      isShow: false
    })
  },
})